/**
 * 
 */
package com.xpec.c4.game.login;

import com.xpec.c4.game.utility.GUID;
import com.xpec.c4.message.MessageTypes;
import com.xpec.c4.message.login.SAccountCharacterListResponse;
import com.xpec.c4.message.login.SAccountCharacterLoginResponse;
import com.xpec.c4.message.login.SAccountLoginTokenInfo;
import com.xpec.c4.message.login.SAccountMessageData;
import com.xpec.c4.service.message.MessageAction;
import com.xpec.c4.service.message.NetMessage;

/**
 * 登录发送
 * 
 * @author lipeilin
 * @2011-5-11 下午06:51:05
 *
 */
public class LoginSender {
	
	/**
	 * 发送状态信息
	 *
	 *  @param sessionID
	 *  @param code
	 */
	public static void sendAccountMessage(GUID sessionID,int code){
		SAccountMessageData data = new SAccountMessageData();
		data.setErrorCode(code);
		NetMessage msg = new NetMessage();
		msg.setMessageType(MessageTypes.S_ACCOUNT_MESSAGE);
		msg.setMessageContent(data);
		msg.setSessionID(sessionID);
		MessageAction.sendMessage(msg);
	}
	
	/**
	 * 发送状态信息
	 *
	 *  @param sessionID
	 *  @param code
	 */
	public static void sendAccountMessage(GUID sessionID,SAccountMessageData data){
		NetMessage msg = new NetMessage();
		msg.setMessageType(MessageTypes.S_ACCOUNT_MESSAGE);
		msg.setMessageContent(data);
		msg.setSessionID(sessionID);
		MessageAction.sendMessage(msg);
	}

	/**
	 * 角色列表
	 * 
	 * @param sessionID
	 */
	public static void sendCharacterList(GUID sessionID, SAccountCharacterListResponse msg){
		MessageAction.sendMessage(sessionID, MessageTypes.S_ACCOUNT_CHARACTER_LIST_RESPONSE, msg);
	}
	
	/**
	 * 角色登录信息
	 *
	 *  @param sessionID
	 *  @param code
	 */
	public static void sendCharactorLoginResponse(GUID sessionID, SAccountCharacterLoginResponse msg){
		MessageAction.sendMessage(sessionID, MessageTypes.S_ACCOUNT_CHARACTER_LOGIN_RESPONSE, msg);
	}
//	
//	/**
//	 * 角色信息
//	 *
//	 *  @param sessionID
//	 *  @param msg
//	 */
//	public static void sendCharactorCreateResponse(GUID sessionID, CS msg){
//		MessageAction.sendMessage(sessionID, MessageTypes.S_ACCOUNT_CHARACTER_CREATE_RESPONSE, msg);
//	}
//	
	public static void sendAccountLoginToken(GUID sessionID, SAccountLoginTokenInfo info){
		MessageAction.sendMessage(sessionID, MessageTypes.S_ACCOUNT_LOGIN_RANDOM_TOKEN, info);
	}

//	public static void sendTencentPlayerInfo(GUID sessionID, TencentPlayerInfo tpinfo, String figureUrl) {
//		MessageAction.sendMessage(sessionID,MessageTypes.S_TENCENT_PLAYER_INFO_TO_CLIENT, new STencentPlayerInfo(tpinfo,figureUrl));		
//	}
}
